package com.example.springbootredis.dao;

import com.example.springbootredis.pojo.Product;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: 19239
 * @Description:
 * @Date: 2024/5/10
 * @Version: 1.0
 */

@Repository
public class ProductDao {

    ArrayList<Product> products = new ArrayList<>();

    public List<Product> getProductAll() {

        products.add(new Product("iphone", 1, 100));
        products.add(new Product("iphone12", 2, 1000));
        products.add(new Product("iphone13", 3, 1100));
        products.add(new Product("iphone15", 4, 1400));

        return products;
    }

    public boolean addProduct(Product product) {
        return products.add(product);
    }

}
